/**
 * 版权所有@北京博创联动科技有限公司。未经许可，不得擅自复制、传播
 */
package com.uptech.homer.beans;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * 车身CAN信息
 *
 * @author lei
 */
public class CanInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    private String key;
    private String value;


    public CanInfo() {
    }

    public CanInfo(String key,
                   Object value) {
        this.key = key;
        this.value = value.toString();
    }

    public CanInfo(String key,
                   String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * @return the key
     */
    public String getKey() {
        return key;
    }

    /**
     * @param key the key to set
     */
    public void setKey(String key) {
        this.key = key;
    }

    /**
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(String value) {
        this.value = value;
    }


    public static class Group implements Serializable {
        private static final long serialVersionUID = 1L;

        private String name;
        private ArrayList<CanInfo> children;

        public Group() {
        }

        public Group(String name) {
            this.name = name;
            this.children = new ArrayList<CanInfo>();
        }

        /**
         * @return the name
         */
        public String getName() {
            return name;
        }

        /**
         * @param name the name to set
         */
        public void setName(String name) {
            this.name = name;
        }

        public void addChild(CanInfo canInfo) {
            children.add(canInfo);
        }

        /**
         * @return the children
         */
        public ArrayList<CanInfo> getChildren() {
            return children;
        }

        /**
         * @param children the children to set
         */
        public void setChildren(ArrayList<CanInfo> children) {
            this.children = children;
        }

    }
}
